# -*- coding: UTF-8 -*-
# vim: expandtab sw=4 ts=4 sts=4
#
#     This file is part of IMAPylator
#
#    IMAPylator is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    Foobar is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.


class IMAPylatorMatch:

    def matchFolder(self, folder, opt=None):
        '''
        folder: folder name to check
        opt: argument passed via command line (-F switch)

        return True if folder match
        '''
        raise Exception("IMPLEMENTATION ERROR")

    def match(self, headers, flags, internal_date, folder, opt=None):
        '''
        headers: headers dictionary. 
        flags: message flags. r
        internal_date: a tuple of imap INTERNALDATE of message
        folder: message folder
        opt: command line options (-M switch)

        return True if message match
        '''
        raise Exception("IMPLEMENTATION ERROR")

    def action(self, message, flags, folder, internal_date, opt=None):
        '''
        message:
        flags:
        folder:
        internal_date:
        opt:  command line options (-A switch)

        Manipulate message, flags, internaldate and folder.

        Set self.message self.flags self.internal_date self.folder

        return a string representing the action to perform on self.message.
        The return string must be: dunno, replace, delete, upload
        '''
     
        raise Exception("IMPLEMENTATION ERROR")
